<?php
class HackerU_Auth
{
	private static $instance = null;
	
	public static function getInstance()
	{
		if(self::$instance === null){
			self::$instance = new self();
		}
		return self::$instance;
	}
	
	private function __construct()
	{
		
	}
	
	private function getAllowedAction()
	{
		return array(
			'users/register'
		);
	}
	
	public function store($userData)
	{
		HackerU_Session::getInstance()->userData = $userData;
	}
	
	public function isAuth($actionData)
	{
		$allowedAction = $this->getAllowedAction();
		if(in_array($actionData, $allowedAction)){
			return true;
		}
		return HackerU_Session::getInstance()->userData;
	}
	
	public function getLoginAction()
	{
		return 'users/login';
	}
}